<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var name='abc';
        var sex='女';
        switch(sex){
            case '男':
            alert(name + '先生，你好');
            break;
            case '女':
            alert(name +'女士，你好');
            break;
            default:
                alert(name +'你好');
        }
    </script>
</head>
<body>

</body>
</html>